package org.example.jiaxiao.controller;

import org.example.jiaxiao.entity.Course;
import org.example.jiaxiao.service.ExtractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api")

public class ExtractController {

    @Autowired
    private ExtractService extractService;

    @GetMapping("/classes")
    public ResponseEntity<List<Course>> extractCourse() {
        List<Course> courses = extractService.extractCourse();
        return ResponseEntity.ok(courses);
    }
}